# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgbase=python-yattag
pkgname=('python2-yattag' 'python-yattag')
_pkgname=yattag
pkgver=1.16.1
pkgrel=1
pkgdesc='Generate HTML or XML in a pythonic way.'
arch=('any')
url='https://pypi.org/project/yattag/#files'
license=('LGPL')
makedepends=('python2-setuptools' 'python-setuptools')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('afdd5ed7921a98a50d4f0139121014a25730f4051a21f189f6543df8a9da92790b290d0ddb65248f94b9947622f0ac256f1d5eec5fc82fcbbc7195f18d69a540')

prepare() {
  cp -a "$_pkgname-$pkgver"{,-2}
}

build() {
  cd "$_pkgname-$pkgver-2"

  python2 setup.py build

  cd "$srcdir/$_pkgname-$pkgver"

  python setup.py build
}

package_python2-yattag() {
  depends=('python2')

  cd "$_pkgname-$pkgver-2"

  python2 setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build
}

package_python-yattag() {
  depends=('python')

  cd "$_pkgname-$pkgver"

  python setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build
}

